<?php 
require_once('../frame/spyc/spyc.php');
require_once("RoomsUI.php");
require_once ("ConsultaPorMail.php");

class RoomsController
{	
	
	public $do;
	
		
    //-------------------------------------------
	
	function __construct() {
		
		$this->do="doInit";
	}
	
	
	//-------------------------------------------
	
	function control() {
	
		if (isset($_GET["do"])){
			$this->do=$_GET["do"];
		};
		
		if ($this->do=="doInit"){
			$this->doInit();
		};
					
		if ($this->do=="doSendMail"){
			$this->doSendMail();
			$this->doInit();
		};
		
	}
	
	//-------------------------------------------
	
	function doInit() {
	
		$ui=new RoomsUI();
		$ui->data=Spyc::YAMLLoad('../yaml/rooms.yaml');
		$ui->display();
	}
	
	//-------------------------------------------
	
	function doSendMail() {
	
		$ctr=new ConsultaPorMail();
		$ctr->control();	
		
	}
}	
?>